package org.jage.student.missevo.solution.death;

import org.jage.platform.component.annotation.Inject;
import org.jage.property.PropertyField;
import org.jage.student.missevo.solution.agent.MissEvoSimpleAgent;

public class LowEnergyDie implements IShouldDie {

	@Inject
	@PropertyField(propertyName = "energyThreshold")
	private double energyThreshold;
	
	@Override
	public boolean decide(MissEvoSimpleAgent agent) {
		if (agent == null) throw new IllegalArgumentException("agent cannot be null");
		
		return agent.getEnergy() <= energyThreshold;
	}
}
